package day17;
import java.util.Scanner;

/**
 * 题目:杨辉三角的变形
 * https://www.nowcoder.com/practice/8ef655edf42d4e08b44be4d777edbf43?tpId=37&&tqId=21276&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 */
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = 2 * n - 1;
        int[][] array = new int[n][m];
        //初始化
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                array[i][j] = 0;
            }
        }
        array[0][0] = 1;
        for (int i = 1; i < n; i++) {
            array[i][0] = array[i][2 * i] = 1; //每一行第一个和最后一个都为1
            for (int j = 1; j < 2 * i; j++) {
                if (j == 1) {    //表示左上角到右上角只有两个数
                    array[i][j] = array[i - 1][j] + array[i - 1][j - 1];
                } else {
                    array[i][j] = array[i - 1][j] + array[i - 1][j - 1] + array[i - 1][j - 2];
                }
            }
        }
        int k = 0;
        for (; k < m; k++) {
            if (array[n - 1][k] % 2 == 0 ) {
                System.out.println((k + 1));
                break;
            }
        }
        if (k == m) {
            System.out.println(-1);
        }
    }
}